/*
 * Copyright 2010 Biz-e (info@biz-e.nl)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.gwt.baselib.ui.client.menu;

import java.util.List;

import nl.biz_e.gwt.baselib.ui.client.IAppManager;

import com.google.gwt.user.client.ui.Widget;

/**
 * TODO: Write type comment
 * 
 * @author Joost A. Bloemsma
 * 
 */
public interface IMenuPanelManager {
	
	/**
	 * Can be used to register an alternate log/logout widget for the menubar.<br/>
	 * Will only be used if {@link IAppManager#useGoogleLogin()} is set to
	 * false. If it is set to true a standard hyperlink to the Google
	 * Authorisation service will be used.
	 * 
	 * @param widget
	 */
	public void setLogInOutWidget(Widget widget);
	
	/**
	 * Add menu items to the menu
	 * 
	 * @param items
	 */
	public void addMenuItems(List<IMenuItem> items);
	
	/**
	 * Add a menuitem to the menu
	 * 
	 * @param menuItem
	 */
	public void addMenuItem(IMenuItem menuItem);
	
	/**
	 * @param logInUrl
	 *        the logInUrl to set
	 */
	public void setLogInUrl(String logInUrl);
	
	/**
	 * @param logOutUrl
	 *        the logOutUrl to set
	 */
	public void setLogOutUrl(String logOutUrl);
	
	/**
	 * @param userName
	 *        the userName to set
	 */
	public void setUserName(String userName);
	
	/**
	 * @param loggedIn
	 *        the loggedIn to set
	 */
	public void setLoggedIn(boolean loggedIn);
	
	/**
	 * @return loggedIn
	 */
	public boolean isLoggedIn();
	
	/**
	 * @param logInText
	 *        the logInText to set
	 */
	public void setLogInText(String logInText);
	
	/**
	 * @param logOutText
	 *        the logOutText to set
	 */
	public void setLogOutText(String logOutText);
	
	/**
	 * Sets a menuitem to the selected state
	 * 
	 * @param item
	 * @param selected
	 */
	public void setMenuItemSelected(IMenuItem item, boolean selected);
	
	/**
	 * Sets all menuitems to unselected, except for the passed item.
	 * 
	 * @param item
	 */
	public void setOnlySelectedMenuItem(IMenuItem item);
	
	/**
	 * @return the IAppManager
	 */
	public IAppManager getAppManager();

	/**
	 * @return the userName
	 */
	public String getUserName();
	
}